<?php
/**

 //  [DoYouHaoBaby!] Init Desktop APP - %APP_NAME% - %APP_NAME%
 //  +---------------------------------------------------------------------
 //
 //  “Copyright”
 //  +---------------------------------------------------------------------
 //  | (C) 2010 - 2099 http://doyouhaobaby.net All rights reserved.
 //  | This is not a free software, use is subject to license terms
 //  +---------------------------------------------------------------------
 //
 //  “About This File”
 //  +---------------------------------------------------------------------
 //  | %APP_NAME% Index控制器
 //  +---------------------------------------------------------------------

*/

!defined('DYHB_PATH') && exit;

class IndexController extends Controller{

	public function index(){
		$this->display();
	}

	public function click_me(){
		$this->initMessageQueue();
		$oUserName=$this->post('user_name');// 获取表单对象，该数据为对象
		$oUserPassword=$this->post('user_password');
		$sUserName=$oUserName->get_text();// 取得表单值
		$sUserPassword=$oUserPassword->get_text();
		// 将错误消息记录到消息队列
		// 不使用用$this->MQT() 等价于 $this->MQT() 等价于 $this->MOT(MSGCORE_BAD)
		// 要打印其它类型的消息，请使用 $this->MQT( MSGCORE ) OR $this->MQT( MGGCORE_DEBUG ) 等等
		//$this->MQT();
		if(empty($sUserName)){
			$this->MQ('用户名不能为空！');
		}

		if(empty($sUserPassword)){
			$this->MQ( '用户密码不能为空');
		}
		if($sUserName!='admin'){
			$this->MQ('用户名不正确！');
		}
		if($sUserPassword!='123456'){
			$this->MQ( '用户密码不正确！' );
		}
		if($this->IE()){// 判断是否存在错误信息
			$this->E();
		}
		else{
			$this->destroyWindow();// 关闭主窗口
			$this->S('你输入的信息正确，你的用户名为'.$sUserName.'，密码为'.$sUserPassword.'！');
		}
	}
	
}
